﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static int GCD(int a, int b)
        {
            if (b == 0)
            {
                return a;
            }
            else
            {
                return GCD(b, a % b);
            }
        }
        static void Main(string[] args)
        {
            Console.Write("a = ");
            string a = Console.ReadLine();
            int A = Int32.Parse(a);

            Console.Write("b = ");
            string b = Console.ReadLine();
            int B = Int32.Parse(b);

            Console.WriteLine("Result : " + GCD(A, B));
            Console.ReadLine();
        }
    }
}
